package com.sq.util.web;

import java.util.Map;

import org.apache.commons.codec.CharEncoding;
import org.apache.http.client.methods.HttpDelete;

/**
 * @author sq
 *
 */
public class HttpDeleteUtil extends BaseHttpUtil {

    public static String execute(String url) throws Exception {
        return execute(new HttpDelete(url), null, CharEncoding.UTF_8);
    }

    public static String execute(String url, Map<String, String> headers, String charset) throws Exception {
        return execute(new HttpDelete(url), headers, charset);
    }

    /**
     * delete请求
     */
    private static String execute(HttpDelete httpdelete, Map<String, String> headers, String charset) throws Exception {
        setHeaders(httpdelete, headers);
        return request(httpdelete, charset);
    }

}
